#ifndef MBAPPWIG_H
#define MBAPPWIG_H

#include <QWidget>
#include <QUdpSocket>
#include <QImage>
#include <QTimer>
namespace Ui {
class MbappWig;
}

class MbappWig : public QWidget
{
    Q_OBJECT

public:
    explicit MbappWig(QWidget *parent = 0);

    void startStreaming();
    void stopStreaming();
    void saveImage(const QByteArray &imageData);
    ~MbappWig();

private:
    Ui::MbappWig *ui;
    QUdpSocket *udpSocket;
    QHostAddress serverAddress;
    quint16 serverPort;
    QTimer *frameTimer;
    QImage currentFrame;
    bool isStreaming;

public slots:
    void on_connectButton_clicked();
    void on_captureButton_clicked();
    void on_stopButton_clicked();
    void readPendingDatagrams();
    void displayFrame();
};

#endif // MBAPPWIG_H
